Task #M008C

Memory 16 MB Time 1000 ms Complexity 25 %
14

  

The number of numbers

You are given three integers L, R and S, you have to write a program that calculates the count of numbers between L and R to which the sum of digits is equals with S.


Input:

Three integers L, R, and \(S (0 < L ≤ R ≤ 10^{15}, 0 < S ≤ 500)\) are given in a single line


Output:

Print the number of digits in a given row whose sum is S


Examples
# input.txt output.txt
1
100 500 7
22
Submit answer
Please, sing in, to complete this action, if you don't have account, you can sign up any moment